<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="../../../include/admincontent.jsp" %>
<div id="Content">
    <div class="btnbar">
       <%-- <button type="button" class="save" id="ms_ok">通过</button>
        <button type="button" class="del" id="ms_no">未通过</button>--%>
        <button type="button" class="list" id="ms_singleresult">录入面试结果</button>
        <button type="button" class="list" id="ms_plan">面试安排</button>
        <button type="button" class="list" id="ms_msg">发短信</button>
           <%--<button type="button" class="card" id="mspublishresult2" fid="${fid}" deptcode="${deptcode}">公布/屏蔽安排</button>--%>
           <button type="button" class="card" id="mspublishresult" fid="${fid}" deptcode="${deptcode}">公布/屏蔽安排</button>
        <%--<button type="button" class="import" id="ms_result">导入面试成绩</button>--%>
        <button type="button" class="list" id="do_next">进入下一步</button>
        <button type="button" class="save" id="resume_output">导出</button>
        <button type="button" class="save" id="resume_input">导入</button>
        <button type="button" class="list" id="do_tjgw" pid="${pid}" fid="${fid}" deptcode="${deptcode}">推荐其他岗位
        </button>
           <button type="button" class="list" id="do_gwpp" pid="${pid}" fid="${fid}" deptcode="${deptcode}">岗位匹配</button>
    </div>

    <!-- 面试计划 -->
    <div id="planpanel" class="condition_cont">
        <form id="thisform1" method="post" action="/Do/MS/PlanAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}">
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="80">面试时间:</td>
                    <td width="300">
                        <div><input type="text" name="starttime" class="select" datatype="*" nullmsg="面试时间不能为空"
                                    onFocus="blur()" onclick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})"/></div>
                    </td>
                    <td width="45">评价表:</td>
                    <td width="200">
                        <div><select id="evaluationid" name="evaluationid" datatype="*"
                                     nullmsg="面试评价表不能为空">${evaluation}</select></div>
                    </td>
                    <td width="25" class="link"><a href='javascript:viewEvaluation();'>查看</a></td>
                    <td></td>

                </tr>
                <tr>
                    <td>面试地址:</td>
                    <td>
                        <div><select name="address" datatype="*" nullmsg="面试地址不能为空">${dz}</select></div>
                    </td>
                    <td>考官组:</td>
                    <td>
                        <div><select id="examinerid" name="examinerid" datatype="*"
                                     nullmsg="考官不能为空">${examiner}</select></div>
                    </td>
                    <td class="link"><a href='javascript:viewExaminer();'>查看</a></td>
                    <td></td>
                </tr>
                <tr>
                    <td width="80">确认截止时间:</td>
                    <td  colspan="4">
                        <div><input type="text" name="endtime" class="select" onFocus="blur()" onclick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})"/></div>
                    </td>
                    <td></td>

                </tr>
                <tr>
                    <td>注意事项:</td>
                    <td colspan="4">
                        <div id="div_mszysx">
                            <textarea name="mszysx" id="mszysx" style="width:99%;height:150px;" > ${mszysx}</textarea>
                        </div>
                    </td>
                    <td style="text-align:left">笔试注意事项,如无注意事项<a href="javascript:clearZysx()">清除</a>内容即可</td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="5">
                        <button type="submit" class="op">保存面试安排</button>
                    </td>
                </tr>
                </thead>
            </table>
            <div id="msusers"></div>
        </form>
    </div>

    <!-- 面试通知 -->
    <div id="msgpanel" class="condition_cont">
        <form id="thisform2" method="post" action="/Do/MS/MsgAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}">
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="60">短信模版：</td>
                    <td width="500">
                        <div><select id="dxmb" datatype="*" nullmsg="短信模版不能为空！">${dxmb}</select></div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td>短信内容：</td>
                    <td>
                        <div><textarea name="dxnr" datatype="*" nullmsg="短信内容不能为空！"></textarea></div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <button type="submit" class="save">提 交</button>
                    </td>
                    <td></td>
                </tr>
                </thead>
            </table>
            <div id="msgusers"></div>
        </form>
    </div>

    <div id="msresultpanel" class="condition_cont">
        <form id="thisform3" method="post" action="/Do/MS/SingleResultAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}">
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="80">面试时间:</td>
                    <td width="300">
                        <div><input type="text" name="starttime" class="select" datatype="*" nullmsg="面试时间不能为空"
                                    onFocus="blur()" onclick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})"/></div>
                    </td>
                    <td>面试地址:</td>
                    <td>
                        <div><select name="address" datatype="*" nullmsg="面试地址不能为空">${dz}</select></div>
                    </td>

                </tr>
                <tr>
                    <td>面试成绩:</td>
                    <td>
                        <div><input type="text" name="mspoint" datatype="*" nullmsg="面试成绩不能为空"></input></div>
                    </td>
                    <td>面试结果:</td>
                    <td>
                        <div>
                            <select name="msresult" datatype="*" nullmsg="面试结果不能为空">
                                <option value="未面试">未面试</option>
                                <option value="未通过">未通过</option>
                                <option value="已通过">已通过</option>
                                <option value="待定">待定</option>
                            </select>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>备注:</td>
                    <td colspan="5">
                        <div id="div_msremark">
                            <textarea name="msremark" id="msremark" style="width:99%;height:150px;" > ${msremark}</textarea>
                        </div>
                    </td>

                </tr>
                <tr>
                    <td></td>
                    <td colspan="5">
                        <button id="btn_singlemsresult" type="submit" class="op">保存面试结果</button>
                    </td>
                </tr>
                </thead>
            </table>
            <div id="mssinglerusers"></div>
        </form>
    </div>

    <!-- 筛选条件 -->
    <%--<div id="searchbox">
        <form id="sform">
            <input type="hidden" name="proid" value="${pid}"/>
            <input type="hidden" name="path" value="/${fid}/"/>
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td>姓名:</td>
                    <td>
                        <div><input type="text" name="name"/></div>
                    </td>
                    <td>身份证号:</td>
                    <td>
                        <div><input type="text" name="cardno"/></div>
                    </td>

                    <td>短信通知:</td>
                    <td colspan="3">
                        <div>
                            <select name="notice">
                                <option value="-1">全部</option>
                                <option value="0">已发通知</option>
                                <option value="1">未发通知</option>
                            </select>
                        </div>
                    </td>
                    <td>面试结果:</td>
                    <td colspan="3">
                        <div>
                            <select name="msresult">
                                <option value="">全部</option>
                                <option value="未面试">未面试</option>
                                <option value="未通过">未通过</option>
                                <option value="已通过">已通过</option>
                            </select>
                        </div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    &lt;%&ndash;<td>招聘地区:</td>
                    <td>
                        <div><select name="rcode">
                            <option value="">不限</option>
                            ${regions}</select></div>
                    </td>&ndash;%&gt;
                   <td>是否确认:</td>
                    <td>
                        <div><select name="isconfirm">
                           <option value="">全部</option>
                            <option value="是">是</option>
                            <option value="否">否</option>
                            </select>
                        </div>
                     </td>
                    <td>毕业院校:</td>
                    <td>
                        <div><input type="text" name="university"/></div>
                    </td>
                    <td>所学专业:</td>
                    <td colspan="3">
                        <div><input type="text" name="majorname"/></div>
                    </td>
                    <td>最高学历:</td>
                    <td colspan="3">
                        <div><select name="education">
                            <option value="">不限</option>
                            ${education}</select></div>
                    </td>
                    <td></td>
                </tr>
                <tr class="moretj">
                    <td width="80">民族:</td>
                    <td width="150">
                        <div><select name="mzcode">
                            <option value="">不限</option>
                            ${minzu}</select></div>
                    </td>
                    <td width="80">政治面貌:</td>
                    <td width="150">
                        <div><select name="zzmmcode">
                            <option value="">不限</option>
                            ${zzmm}</select></div>
                    </td>
                    <td width="70" style="text-align:right;">年龄:</td>
                    <td width="60">
                        <div><input type="text" name="agefrom"/></div>
                    </td>
                    <td width="16" style="text-align:center;">至</td>
                    <td width="60">
                        <div><input type="text" name="ageto"/></div>
                    </td>
                    <td width="70" style="text-align:right;">身高:</td>
                    <td width="50">
                        <div><input type="text" name="heightfrom"/></div>
                    </td>
                    <td width="36" style="text-align:center;">至</td>
                    <td width="50">
                        <div><input type="text" name="heightto"/></div>
                    </td>
                    <td></td>
                </tr>
                <tr class="moretj">
                    <td>简历编号:</td>
                    <td>
                        <div><input type="text" name="code"/></div>
                    </td>

                    <td>户口所在地:</td>
                    <td>
                        <div><input type="text" name="hukouaddress"/></div>
                    </td>
                    <td>现居住地:</td>
                    <td colspan="3">
                        <div><input type="text" name="nowaddress"/></div>
                    </td>
                    <td>是否放弃:</td>
                    <td colspan="3">
                        <div>
                            <select name="fqstate">
                                <option value="">全部</option>
                                <option value="未放弃" selected>未放弃</option>
                                <option value="已放弃">已放弃</option>
                            </select>
                        </div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td colspan="12">
                        <button id="searchbtn" type="button" class="search"></button>
                    </td>
                    <td>
                        <button id="showhidebtn" type="button" class="moretjbtn0" onclick="moreparam()"
                                title="高级查询"></button>
                    </td>
                </tr>
                </thead>
            </table>
        </form>
    </div>--%>

    <div id="searchbox">
        <form id="sform">
            <input type="hidden" name="proid" value="${pid}"/>
            <input type="hidden" name="path" value="${fid}"/>
            <input type="hidden" name="rcount" id="checkrount" value=""/>
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="60">应聘岗位:</td>
                    <td >
                        <div>
                            <%-- <input type="text" name="jname"/>--%>
                            <select name="jname">
                                <option value="">请选择</option>
                                <c:forEach var="projectinfojobs" items="${jobs}" varStatus="item" >
                                    <c:choose>
                                        <c:when test="${projectinfojobs!=null}">
                                            <option value="${projectinfojobs.jobname}">${projectinfojobs.jobname}</option>
                                        </c:when>

                                    </c:choose>
                                </c:forEach>
                            </select>
                        </div>
                    </td>
                    <td width="60">姓名:</td>
                    <td>
                        <div><input type="text" name="name"/></div>
                    </td>
                    <td width="60">身份证号:</td>
                    <td>
                        <div><input type="text" name="cardno"/></div>
                    </td>

                    <td width="60">所学专业:</td>
                    <td >
                        <div>
                            <input type="text" name="majorname"/>
                        </div>
                    </td>
                    <td width="60">毕业院校:</td>
                    <td >
                        <div>
                            <input type="text" name="university"/>
                        </div>
                    </td>

                </tr>
                <tr>
                    <td >毕业时间:</td>
                    <td>
                        <div><input type="text" name="graduationtime"/></div>
                    </td>
                    <td>联系电话:</td>
                    <td>
                        <div>
                            <input type="text" name="tel"/>
                        </div>
                    </td>
                    <td>最高学历:</td>
                    <td >
                        <div><select name="education">
                            <option value="-1">不限</option>
                            ${education}</select></div>
                    </td>
                    <td>面试结果:</td>
                    <td >
                        <div>
                            <select name="msresult">
                                <option value="">全部</option>
                                <option value="未面试">未面试</option>
                                <option value="未通过">未通过</option>
                                <option value="已通过">已通过</option>
                                <option value="待定">待定</option>
                            </select>
                        </div>
                    </td>
                    <td>意向地点:</td>
                    <td >
                        <div>
                            <input type="text" name="presentsalaryamount"/>
                        </div>
                    </td>
                </tr>
                <tr class="moretj">
                    <td width="60">民族:</td>
                    <td width="150">
                        <div><select name="mzcode">
                            <option value="">不限</option>
                            ${minzu}</select></div>
                    </td>
                    <td width="60">政治面貌:</td>
                    <td width="150">
                        <div><select name="zzmmcode">
                            <option value="">不限</option>
                            ${zzmm}</select></div>
                    </td>
                    <td width="60" style="text-align:right;">年龄:</td>
                    <td width="160">
                        <div><input type="text" name="agefrom" style="max-width: 40%"/>至<input type="text" name="ageto" style="max-width: 40%"/></div>
                    </td>
                    <%-- <td width="16" style="text-align:center;">至</td>
                     <td width="60">
                         <div><input type="text" name="ageto"/></div>
                     </td>--%>
                    <td width="60" style="text-align:right;">身高:</td>
                    <td width="160">
                        <div><input type="text" name="heightfrom" style="max-width: 40%"/>至<input type="text" name="heightto" style="max-width: 40%"/></div>
                    </td>
                    <%--  <td width="36" style="text-align:center;">至</td>
                      <td width="50">
                          <div></div>
                      </td>--%>
                    <td width="60">性别:</td>
                    <td>
                        <div>
                            <select name="sexname">
                                <option value="">不限</option>
                                <option value="男">男</option>
                                <option value="女">女</option>
                            </select>
                        </div>
                    </td>
                </tr>
                <tr class="moretj">


                    <td>户口所在地:</td>
                    <td>
                        <div><input type="text" name="hukouaddress"/></div>
                    </td>
                    <td>现居住地:</td>
                    <td>
                        <div><input type="text" name="nowaddress"/></div>
                    </td>
                    <td>是否放弃:</td>
                    <td>
                        <div>
                            <select name="fqstate">
                                <option value="">全部</option>
                                <option value="未放弃" selected>未放弃</option>
                                <option value="已放弃">已放弃</option>
                            </select>
                        </div>
                    </td>
                    <td>是否确认:</td>
                    <td>
                        <div><select name="isconfirm">
                            <option value="">全部</option>
                            <option value="是">是</option>
                            <option value="否">否</option>
                        </select>
                        </div>
                    </td>
                    <td>短信通知:</td>
                    <td >
                        <div>
                            <select name="notice">
                                <option value="-1">全部</option>
                                <option value="0">已发通知</option>
                                <option value="1">未发通知</option>
                            </select>
                        </div>
                    </td>
                </tr>
                <tr class="moretj">


                    <td>面试安排:</td>
                    <td>
                        <div>
                            <select name="msplan">
                            <option value="">全部</option>
                            <option value="YES">已安排</option>
                            <option value="NO">未安排</option>
                        </select>
                        </div>
                    </td>
                    <td>面试时间:</td>
                    <td>
                        <div>
                            <%--<input type="text" name="msplantime" placeholder="日期格式:2019-05-28 09:00"/>--%>
                                <select name="msplantime">
                                    <option value="">全部</option>
                                    ${mstimes}
                                </select>
                        </div>
                    </td>
                    <td>面试地点:</td>
                    <td>
                        <div>
                            <%--<input type="text" name="msplantime" placeholder="日期格式:2019-05-28 09:00"/>--%>
                                <select name="msaddress">
                                    <option value="">全部</option>
                                    ${msaddress}
                                </select>
                        </div>
                    </td>
                    <td width="60">是否转岗:</td>
                    <td width="100">
                        <div>
                            <select name="ischangejob">
                                <option value="">全部</option>
                                <option value="是">是</option>
                                <option value="否">否</option>
                            </select>
                        </div>
                    </td>
                    <td width="60">面试成绩:</td>
                    <td width="100">
                        <div>
                            <select name="scorearea">
                                <option value="">全部</option>
                                <option value="R60">60分及以上</option>
                                <option value="L60">60分以下</option>
                            </select>
                        </div>
                    </td>
                </tr>
              <%--  <tr class="moretj">

                    <td colspan="9"></td>
                </tr>--%>
                <tr>
                    <td colspan="9">
                        <div style="padding-top: 8px;"> <button id="searchbtn" type="button" class="search"></button>
                            <button id="clearbtn" type="reset" class="del" title="清除" style="flex: 1;margin-left: 5px;"></button>
                        </div>
                    </td>
                    <td>
                        <button id="showhidebtn" type="button" class="moretjbtn0" onclick="moreparam()"
                                title="高级查询"></button>
                    </td>
                </tr>
                </thead>
            </table>
        </form>
    </div>
    <div id="page_top" class="page"></div>
    <table class="treeTable" id="tablelist">
        <thead>
        <tr>
            <td width="20"><input type="checkbox" class="allcheckbox" title="选择全部/取消全选"/></td>
            <td width="30">序号</td>
            <%--<td width="60">简历编号</td>--%>
            <td width="80">姓名</td>
            <td width="110">身份证号</td>
            <!-- <td width="60">生源地</td> -->
            <td width="100">毕业院校</td>
            <td width="90">所学专业</td>
            <td width="70">学历</td>
            <td width="90">岗位组</td>
            <td width="80">面试时间</td>
            <td width="140">面试地点</td>
            <%--<td width="40">评价表</td>
            <td width="40">面试组</td>--%>
            <td width="80">确认时间</td>
            <td width="55">是否确认</td>
            <td width="55">短信通知</td>
            <td width="55">面试得分</td>
            <td width="55">面试结果</td>
            <td width="55">备注</td>
            <td width="80">最近登录</td>
            <td width="80">个人情况</td>
            <td width="55">公布结果</td>
            <td width="50"></td>
        </tr>
        </thead>
        <tbody id="result"></tbody>
    </table>
    <div id="page_bottom" class="page"></div>
</div>
<script charset="utf-8" src="/resources/js/plugins/kindeditor-4.1.10/kindeditor-min.js"></script>
<script charset="utf-8" src="/resources/js/plugins/kindeditor-4.1.10/lang/zh_CN.js"></script>
<script type="text/javascript">
    var pageobj = null;
    var editor;
    KindEditor.ready(function (K) {
        editor= K.create('#mszysx', {
            resizeType: 1,
            items: [ 'removeformat'],
            afterBlur: function () {
                this.sync();
            }
        });
    });
    function clearZysx() {
        editor.html('');
    }
    $(document).ready(function () {
        getList();
        $('#searchbtn').click(function () {
            $('#msusers').html('');
            $('#msgusers').html('');
            getList();
        });
        getMsg();


        //全选当页
        $(document).delegate('.allcheckbox', 'click', function () {
            $(this).parent().parent().parent().next().find('input[type=checkbox]').each(function () {
                var ck = $(this);
                if (ck.is(":checked")) {
                    $('#msusers').append('<input type="hidden" name="uid" value="' + $(this).val() + '"/>');
                    $('#msgusers').append('<input type="hidden" name="uid" value="' + $(this).val() + '"/>');
                } else {
                    $('#msusers input').each(function () {
                        if ($(this).val() == ck.val())
                            $(this).remove();
                    });
                    $('#msgusers input').each(function () {
                        if ($(this).val() == ck.val())
                            $(this).remove();
                    });
                }
            });
        });
        //选择一条
        $(document).delegate('#tablelist tbody tr', 'click', function () {
            var ck = $(this).find('input[type=checkbox]');
            if (ck.is(":checked")) {
                $('#msusers').append('<input type="hidden" name="uid" value="' + ck.val() + '"/>');
                $('#msgusers').append('<input type="hidden" name="uid" value="' + ck.val() + '"/>');
            } else {
                $('#msusers input').each(function () {
                    if ($(this).val() == ck.val())
                        $(this).remove();
                });
                $('#msgusers input').each(function () {
                    if ($(this).val() == ck.val())
                        $(this).remove();
                });
            }
        });

        //面试安排
        $('#ms_plan').click(function () {
            $('#planpanel').slideToggle(300);
            $(this).toggleClass('cur').blur().siblings().removeClass('cur');
            if (!$('#msgpanel').is(":hidden")) {
                $('#msgpanel').slideToggle(300);
            }
        });

        //面试通知
        $('#ms_msg').click(function () {
            $('#msgpanel').slideToggle(300);
            $(this).toggleClass('cur').blur().siblings().removeClass('cur');
            if (!$('#planpanel').is(":hidden")) {
                $('#planpanel').slideToggle(300);
            }
        });

        //导入面试成绩
        $('#ms_result').click(function () {
           // openLayer('导入面试成绩', '/Do/MS/import?pid=${pid}&fid=${fid}&deptcode=${deptcode}', '70%', '50%');
            openpLayer('导入面试成绩', '/Do/MS/importnodetial?pid=${pid}&fid=${fid}&deptcode=${deptcode}', '70%', '50%');
        });

        $('#dxmb').change(function () {
            getMsg();
        });

        $('#do_next').click(function () {
            parent.layer.confirm('所有面试者均可进入下一步进行结果发布。<br>确定要执行吗？', {
                btn: ['是', '否']
            }, function () {
                toNextFlow('/Do/GXInterview/NextAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}','${fid}');
                parent.layer.closeAll();
               /* SubmitAll('/Do/GXInterview/NextAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}', 'msusers');*/
            }, function () {
                parent.layer.closeAll();
            });
        });

    });

    function viewResult(uid, uname) {
        openpLayer('查看面试结果', '/Do/MS/viewResult?uid=' + uid + '&uname=' + uname, '90%', '90%');
    }

    function getList() {
         pageobj =  $('.page').myPagination({
            cssStyle: "pagination",
            saveChecked:true,
            showTitle:true,
            rowNumber:true,
             contextMenu:true,
             contextMenuParam:{
                 menu: [{
                     text: "情况说明",
                     callback: function(ele) {
                         console.log($(this))
                         var tcid=$(ele).find('input[type=checkbox]:eq(0)').attr('id');
                         var rmarkid=$(ele).find('input[type=hidden]:eq(0)').val();
                         var cardno=ele[0].cells[3].innerText;
                         var rname=ele[0].cells[2].innerText;
                         parent.layer.prompt({title: '请填写姓名:'+rname+' 身份证:'+cardno+' 个人情况说明，并确认', formType: 2}, function(text, index){
                             parent.layer.close(index);
                             var cid=tcid.replace('cb_','');
                             $.post("/SaveUserRemark"
                                 ,{id:rmarkid,pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",rid:cid,content:text,rname:rname,cardno:cardno}
                                 ,function (result) {
                                     if (result.state) {
                                         $.Showmsg(result.message);
                                         getList();
                                     }
                                     else {
                                         $.Showmsg(result.message);
                                     }
                                 }
                                 ,"json");
                         });
                     }
                 },
                     {
                         text: "查看个人简历",
                         callback: function(ele) {
                             var url=$(ele).find('a').attr('href');
                             if(!!url){
                                 window.open(url);
                             }
                         }
                     },
                     {
                         text: "刷新列表",
                         callback: function() {
                             pageobj.onReload();
                             $('#msusers').html('');
                             $('#msgusers').html('');
                             $('#tablelist tbody tr').each(function () {
                                 var cb = $(this).find('input[type=checkbox]');
                                 if (cb.length > 0 ) {
                                     cb.removeAttr('checked');
                                     if ($(this).hasClass('checked')) {
                                         $(this).removeClass('checked');
                                     }
                                 }
                             });
                             getList();
                         }
                     }
                 ]
             },
            ajax: {
                on: true,
                url: '${path}/Do/GXInterview/getusers?flowid=${fid}',
                param: $('#sform').serialize(),
                dataType: 'html',
                callback: function (data) {
                    $('#result').html(data);
                    parent.changeFrameHeight();
                    $('#result a').click(function () {
                        event.stopPropagation();
                    });
                    $('#msgusers input').each(function () {
                        var tval = $(this).val();
                        $('#result tr').each(function () {
                            var cb = $(this).find('input[type=checkbox]');
                            if (cb.length > 0 && tval == cb.val()) {
                                cb.attr('checked', 'true');
                                if (!$(this).hasClass('checked')) {
                                    $(this).addClass('checked');
                                }
                            }
                        });
                    });
                }
            }
        });
    }

    //查看评价表
    function viewEvaluation(id) {
        openpLayer('查看面试评价表', '/Do/MS/viewEvaluation?id=' + id, '98%', '98%');
    }

    //查看考官
    function viewExaminer(id) {
        openpLayer('查看面试官', '/Do/MS/viewExaminer?id=' + id, '98%', '98%');
    }
    //编辑面试注意事项
    function editMszysx() {
        //openLayer('编辑注意事项', '/Do/MS/editMszysx', '98%', '400px');
       var oldzysx= $('#div_mszysx').html();
        $('#div_mszysx').empty();

        $('#div_mszysx').append(' <form id="zysxform" method="post" action="/sysconfig/SaveZysxAction"> <div><textarea id="mszysx" name="mszysx" datatype="*" nullmsg="注意事项内容不能为空！"\n' +
            ' style="width:99%;height:200px;">'+oldzysx+'</textarea></div></form');
        $('#btn_save_zysx').show();
        $('#btn_edit_zysx').hide();
        KindEditor.ready(function (K) {
            K.create('#mszysx', {
                resizeType: 1,
                items: ['source', 'removeformat', 'fullscreen'],
                afterBlur: function () {
                    this.sync();
                }
            });
        });

    }
    function saveMszysx() {
        var newzysx=$('#mszysx').val();
        $('#zysxform').ajaxSubmit({
            type: 'post',
            dataType: 'json',
            success: function (data) {
                if (data.url != 'no') {
                   // $.Showmsg(data.Message + ' 马上跳转...');
                    parent.alert(data.Message + ' 马上跳转...',{icon:1});
                } else {
                   // $.Showmsg(data.Message);
                    parent.alert(data.Message,{icon:1});
                }
                setTimeout(function () {
                    //$.Hidemsg();
                    parent.layer.closeAll();
                    if (data.Message == '操作成功！') {
                        $('#div_mszysx').empty();
                        $('#div_mszysx').html(newzysx);
                        $('#btn_save_zysx').hide();
                        $('#btn_edit_zysx').show();
                    }
                }, 2000);
            }
        });
    }
    //查看评价表
    function viewEvaluation() {
        openpLayer('查看面试评价表', '/BaseEvaluation/view?id=' + $('#evaluationid').val(), '98%', '98%');
    }

    //查看考官
    function viewExaminer() {
        openpLayer('查看面试官', '/BaseExaminer/view?id=' + $('#examinerid').val(), '98%', '98%');
    }

    function getMsg() {
        getAjax('/Do/BS/getMsg?code=' + $('#dxmb').val(), null, function (data) {
            $('textarea[name=dxnr]').val(data);
        });
    }


    $(function () {
        $('#resume_output').click(function () {
            //openLayer('请选择要导出的字段', '/ExcelDown/DownDoResume?pid=${pid}&fid=${fid}&deptcode=${deptcode}', '60%', '70%');
            openpLayer('请选择要导出的字段', '/ExcelDown/DownDoResume?pid=${pid}&fid=${fid}&deptcode=${deptcode}&'+$('#sform').serialize(), '60%', '70%');
        });
        $('#resume_input').click(function () {
            openpLayer('Excel数据导入', '/ExcelImport/ImportExcelPage?pid=${pid}&fid=${fid}&deptcode=${deptcode}&'+$('#sform').serialize(), '60%', '500px');
        });
        $('#ms_singleresult').click(function () {
            var checkRows=$('.allcheckbox').data('checkIds');
            if(!!!checkRows||checkRows.length==0){
                parent.layer.alert('至少选择一条信息!', {icon: 5});
                return false;
            }else{

                $('#msresultpanel').slideToggle(300);
                $(this).toggleClass('cur').blur().siblings().removeClass('cur');
                if (!$('#msgpanel').is(":hidden")) {
                    $('#msgpanel').slideToggle(300);
                }
                if (!$('#planpanel').is(":hidden")) {
                    $('#planpanel').slideToggle(300);
                }
                var ids="";
                $(checkRows).each(function (index,itme) {
                    ids+=itme.replace('cb_', '')+",";
                });
                $('#mssinglerusers').empty();
                $('#mssinglerusers').append('<input type="hidden" name="ids" value="'+ids+'" />');
            }
        });

        $('#ms_ok').click(function () {
            var checkRows=$('.allcheckbox').data('checkIds');
            if(!!!checkRows||checkRows.length==0){
                parent.layer.alert('至少选择一条信息!', {icon: 5});
            }else{
                var ids="";
                $(checkRows).each(function (index,itme) {
                    ids+=itme.replace('cb_', '')+",";
                });
                $.post("/Do/MS/resultUpdate",{pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",state:"已通过",ids:ids},function (result) {
                    if (result.state) {
                        parent.layer.alert(result.Message, {icon: 1});
                        getList();
                    }
                    else {
                        parent.layer.alert(result.Message, {icon: 2});
                    }
                },"JSON");

            }
        });
        $('#ms_no').click(function () {
            var checkRows=$('.allcheckbox').data('checkIds');
            if(!!!checkRows||checkRows.length==0){
                parent.layer.alert('至少选择一条信息!', {icon: 5});
               // $.Showmsg('至少选择一条信息');
            }else{
                var ids="";
                $(checkRows).each(function (index,itme) {
                    ids+=itme.replace('cb_', '')+",";
                });
                $.post("/Do/MS/resultUpdate",{pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",state:"未通过",ids:ids},function (result) {
                    if (result.state) {
                        parent.layer.alert(result.Message, {icon: 1});
                        getList();
                    }
                    else {
                        parent.layer.alert(result.Message, {icon: 2});
                    }
                },"JSON");

            }
        });


    });

    $(function () {
        fillSelectState("msresult","${fid}");
    })

    function reloadData() {
        pageobj.onReload();
    }
</script>
</body>
</html>